var app=angular.module("registerapp",[])
 app.controller("registerController",function($scope,$http){
	


	 //注册
	 $scope.onclickRegister=function(){
	
	$http({
		 method:'POST',
		 url:'/test/wsqregister',
		 params:{'name':$scope.name,'pwd':$scope.pwd,'email':$scope.email}
	 }).then(function successCallback(response) {
		 
						
			
			if("Y"==response.data.result){
              $("#myModal").modal('show');
         		
				$("#model").text("注册成功");
         	window.location.href="/test/login.html";
         			         		
         	}else if(response.data.result=="N"){
         		$("#myModal").modal('show');
         		
				$("#model").text("用户名已存在，请重新输入");
         		
         
         		
         	}else{
         			
         	}
				
	         // 请求成功执行代码
	     }, function errorCallback(response) {
	         // 请求失败执行代码
	   });
	
	
	
	
	
	 }
 });